﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="WebBrowserControlSample.MainWindow"
    Title="WebBrowser Control Sample"
    MinHeight="200" MinWidth="200"
    Height="400" Width="800"
    WindowStartupLocation="CenterScreen" Background="LightSteelBlue">

    <DockPanel Background="LightSteelBlue">

        <!-- Standard Navigation Buttons -->
        <DockPanel DockPanel.Dock="Top" Margin="5">
            <Button x:Name="backButton" DockPanel.Dock="Left" Content="_Back" Click="backButton_Click" />
            <Button x:Name="forwardButton" DockPanel.Dock="Left" Margin="5,0,0,0" Content="_Forward" Click="forwardButton_Click" />
            <Button x:Name="refreshButton" DockPanel.Dock="Left" Margin="5,0,0,0" Content="_Refresh" Click="refreshButton_Click" />
            <TextBlock DockPanel.Dock="Left" Margin="10,0,0,0" VerticalAlignment="Center">Address:</TextBlock>
            <Button x:Name="goNavigateButton" DockPanel.Dock="Right" Content="Go (.Navigate)" Click="goNavigateButton_Click" IsDefault="True" />
            <TextBox x:Name="addressTextBox" Text="http://msdn.microsoft.com" />
        </DockPanel>

        <!-- Additional Navigation Buttons -->
        <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="5,0,5,5">
            <Button x:Name="goSourceButton" Content="Go (.Source)" Click="goSourceButton_Click" />
            <Button x:Name="goNavigateToStringButton" Margin="5,0,0,0" Content="Go (.NavigateToString)" Click="goNavigateToStringButton_Click" />
            <Button x:Name="goNavigateToStreamButton" Margin="5,0,0,0" Content="Go (.NavigateToStream)" Click="goNavigateToStreamButton_Click" />
        </StackPanel>

        <!-- Script Function Calling Buttons -->
        <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="5,0,5,5">
            <Button x:Name="loadHtmlDocWithScriptButton" Content="Load HTML Document with Script" Click="loadHtmlDocWithScriptButton_Click"/>
            <Button x:Name="callScriptFunctionNoParamButton" Margin="5,0,0,0" Content="Call Script Function (No Parameters)" Click="callScriptFunctionNoParamButton_Click" />
            <TextBlock DockPanel.Dock="Left" Margin="5,0,0,0" VerticalAlignment="Center">Message:</TextBlock>
            <TextBox x:Name="messageTextBox" Margin="5,0,0,0" Text="Message from WPF" />
            <Button x:Name="callScriptFunctionParamButton" Content="Call Script Function (With Parameters)" Click="callScriptFunctionParamButton_Click" />
        </StackPanel>
        
        <!-- Status Bar -->
        <StatusBar DockPanel.Dock="Bottom">
            <StatusBarItem x:Name="informationStatusBarItem" Content="Ready" />
        </StatusBar>

        <!-- Web Browser Control -->
        <WebBrowser x:Name="webBrowser" Navigating="webBrowser_Navigating" Navigated="webBrowser_Navigated" LoadCompleted="webBrowser_LoadCompleted" />

    </DockPanel>

</Window>
